/** 2023-03-07  17:48   by  CYL @ST
*   编写目的：用于区分new一个对象时，class后边加不加括号的区别，见[A1]。
*   编译（含GDB）指令：g++ -g demo0.cpp -o demo0.o
*/
#include <iostream>
#include <string>

using namespace std;
class Dog{
public:
	int age;
	string name;
	void showName(){
		cout << "The Dog's name is " << name << "The Dog's age is " << age << endl;
		}
};
int main()
{
	Dog Dog0;
	Dog0.age = 8;
	Dog0.name = "2ha";
	Dog0.showName();
	
	Dog *Dog1 = new Dog();	//[A1]这里加了括号的话，就意味着在new的同时，还会初始化这个对象。
	Dog1->age = 2;
	Dog1->name = "hanbuladuo";
	Dog1->showName();

	delete Dog1;
	Dog1=NULL;
	
	return 0;
	}
